package com.wkbb.sports.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wkbb.sports.utils.DateJacksonConverter;
import com.wkbb.sports.utils.DateJacksonSerializer;
import com.wkbb.sports.utils.DoubleJacksonSerializer;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * hlife_train
 * @author 惠普
 * @date 2021-03-22 18:05:14
 */
@Data
public class HlifeTrain implements Serializable {

    /**
     * 训练模式
     */
    private Byte modelType;
    @ApiModelProperty(value = "训练模式 0顺序 1随机 2干扰")
    private Integer trainModel;
    @ApiModelProperty(value = "分配模式  0按学号分配 1按设备顺序分配")
    private Integer fpMode;
    @ApiModelProperty(value = "分组人数  0不分组 -1男女分组")
    private Integer groupNum;
    @ApiModelProperty(value = "设备组别")
    private String groupName;

    private String projectKindName;
	//提交标识
	private String checkCode;
    /**
     * 编号
     */
    private Long id;

    /**
     * 课堂ID
     */
    private Long courseId;

    private Byte projectType;

    /**
     * 类型(1训练 2比赛 3测评)
     */
    private Byte trainType;

    /**
     * 项目ID
     */
    private Long projectId;

    /**
     * 项目名称
     */
    private String projectName;

    /**
     * 学校ID
     */
    private Long orgId;

    /**
     * 年级ID
     */
    private Long gradeId;

    /**
     * 年级名称
     */
    private String gradeName;

    /**
     * 班级id
     */
    private Long classId;

    /**
     * 班级名称
     */
    private String className;

    /**
     * 组别
     */
    private String groupId;

    /**
     * 老师ID
     */
    private Long teacherId;

    /**
     * 标准
     */
    private Byte markType;

    /**
     *         1 -> "跳绳"
     *         2 -> "中长跑"
     *         3 -> "短跑"
     *         4 -> "敏捷"
     *         6 -> "篮球"
     *         7 -> "身高体重"
     *         8 -> "肺活量"
     *         9 -> "体前屈"
     *         10 -> "跳远"
     *         11 -> "仰卧起坐"
     *         12 -> "引体向上"
     *         13 -> "往返跑"
     *         14 -> "实心球"
     *         15 -> "握力"
     *         16 -> "俯卧撑"
     *         17 -> "闭眼单脚站立"
     *         18 -> "篮球运球"
     *         19 -> "足球运球"
     *         20 -> "视力测试仪"
     */
    private Byte projectKind;

    /**
     * 训练标准ID
     */
    private Long projectRuleId;

    /**
     * 训练人数
     */
    private Integer trainCount;

    @ApiModelProperty(value = "训练日期")
    private Date trainDate;

    /**
     * 开始时间
     */
    private Date startTime;

    /**
     * 结束时间
     */
    private Date endTime;

    /**
     * 状态(0未开始 1进行中2已结束3已取消)
     */
    private Byte status;
    
    /**
     * 男生总成绩和
     */
    private Double maleCount;
    
    /**
     * 男生总分和
     */
    private Double maleScore;
    
    /**
     * 男生总数
     */
    private Integer maleTotal;
    
    /**
     * 女生总成绩和
     */
    private Double femaleCount;
    
    /**
     * 女生总分和
     */
    private Double femaleScore;
    
    /**
     * 女生总数
     */
    private Integer femaleTotal;
    
    /**
     * 男生最大值
     */
    private Double maleMaxCount;
    
    /**
     * 男生最小值
     */
    private Double maleMinCount;
    
    
    /**
     * 女生最大值
     */
    private Double femaleMaxCount;
    
    /**
     *  女生最小值
     */
    private Double femaleMinCount;
    
    /**
     * 男生最大分数
     */
    private Double maleMaxScore;
    
    /**
     * 男生最小分数
     */
    private Double maleMinScore;
    
    /**
     * 女生最大分数
     */
    private Double femaleMaxScore;
    
    /**
     *  女生最小分数
     */
    private Double femaleMinScore;
    
    /**
     * 及格率
     */
    @JsonSerialize(using = DoubleJacksonSerializer.class)
    private Double passingRate;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人
     */
    private String createBy;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 修改人
     */
    private String updateBy;
    
    //private List<HlifeTrainStudent> students;
    
   // private List<HlifeTrainStudentAvg> studentAvgs;
    
    private HlifeRunningConfig runingConfig;

    private Double maleAvgCount;
    private Double femaleAvgCount;
    private Double maleAvgScore;
    private Double femaleAvgScore;

//    @JsonSerialize(using = DoubleJacksonSerializer.class)
//    public Double getMaleAvgCount() {
//        if(maleTotal == null || maleTotal == 0) {
//            return null;
//        }
//        return maleCount / maleTotal;
//    }
//
//    @JsonSerialize(using = DoubleJacksonSerializer.class)
//    public Double getFemaleAvgCount() {
//        if(femaleTotal == null || femaleTotal == 0) {
//            return null;
//        }
//        return femaleCount / femaleTotal;
//    }
//
//    @JsonSerialize(using = DoubleJacksonSerializer.class)
//    public Double getMaleAvgScore() {
//        if(maleTotal == null || maleTotal == 0) {
//            return null;
//        }
//        return maleScore / maleTotal;
//    }
//
//    @JsonSerialize(using = DoubleJacksonSerializer.class)
//    public Double getFemaleAvgScore() {
//        if(femaleTotal == null || femaleTotal == 0) {
//            return null;
//        }
//        return femaleScore / femaleTotal;
//    }

    /**
     * 男生中位数
     */
    private Double maleMedianCount;
    
    /**
     * 女生中位数
     */
    private Double femaleMedianCount;
    
	//提高空间
    /*
     * 男生平均值
     */
    private Double maleAvgImproveCount = null;
    
    /*
     * 男生最大值
     */
    private Double maleMaxImproveCount = null;
    
    /*
     * 男生最小值
     */
    private Double maleMinImproveCount = null;
    
    /*
     * 女生平均值
     */
    private Double femaleAvgImproveCount = null;
    
    /*
     * 女生最大值
     */
    private Double femaleMaxImproveCount = null;
    
    /*
     * 女生最小值
     */
    private Double femaleMinImproveCount = null;
    
    /*
     * 男生平均分数
     */
    private Double maleAvgImproveScore = null;
    
    /*
     * 男生最大分数
     */
    private Double maleMaxImproveScore = null;
    
    /*
     * 男生最小分数
     */
    private Double maleMinImproveScore = null;
    
    /*
     * 女生平均分数
     */
    private Double femaleAvgImproveScore = null;
    
    /*
     * 女生最大分数
     */
    private Double femaleMaxImproveScore = null;
    
    /*
     * 女生最小分数
     */
    Double femaleMinImproveScore = null;
    
    /*
     * 失误最少的同学次数
     */
    private Integer minErrorCount = null;
    
    /*
     * 进入状态最快的同学耗时
     */
    private Integer minIntoStateTime = null;
    
    /*
     * 第一名平均耗时
     */
    private Integer minAvgTime = null;
    
    /*
     * 失误总次数
     */
    private Integer totalErrorCount = null;
    
    /*
     * 失误 损失次数
     */
    private Integer lossesCount1 = null;
    
    /*
     * 甩绳速度偏慢 损失次数
     */
    private Integer lossesCount2 = null;
    
    /*
     * 进入状态过慢 损失次数
     */
    private  Integer lossesCount3 = null;


    /**
     * 最大分数
     */
    private Double maxScore;
    /**
     * 最小分数
     */
    private Double minScore;
    /**
     * 平均分数
     */
    private Double avgScore;


    //敏捷班级平均时间
    private  Double classAvg;
    
    //敏捷班级最快
    private  Double  classFast;
    
    //敏捷班级最慢
    private Double  classSlow;
    
    
    //敏捷时间
    private Integer gameTime;
    
    //敏捷男生平均正确率
    private Double  maleRightRate;
    
    //敏捷女生平均正确率
    private Double  femaleRightRate;
    
    //敏捷班级平均正确率
    private Double  classRightRate;
    
    //敏捷男生完成次数
    private Integer  maleFinishCount;
    
    //敏捷女生完成次数
    private Integer   femaleFinishCount;
    
    //班级完成次数
    private Integer    classFinishCount;

    //优秀率
    private Double  excellentRate;
    //是否手动录入
    private Boolean isManual;
    
}